<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:cc="http://java.sun.com/jsf/composite"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui">

    <!-- INTERFACE -->
    <cc:interface>
    </cc:interface>

    <!-- IMPLEMENTATION -->
    <cc:implementation>

        <p:outputPanel rendered="#{not login.logueado}" >
            <div id="login">
                <h:form>
                    <table border="0" cellspacing="0">
                        <tr>
                            <th>
                                Ingreso
                            </th>
                        </tr>
                        <tr>
                            <td>
                                <h:panelGrid columns="1" cellpadding="2"
                                             style="width:100%;  padding-left: 5px; text-align: left; " >
                                    <h:outputLabel  value="Usuario" />
                                    <p:inputText value="#{login.username}" styleClass="passInput" />
                                    <h:outputLabel value="Contraseña" />
                                    <p:password feedback="false" value="#{login.password}" 
                                                styleClass="passInput" />
                                </h:panelGrid>
                                <p:messages globalOnly="true" showDetail="false" />
                                <p:commandButton value="Entrar" action="#{login.loguearse}" ajax="false" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <div class="footer">
                                    <h:link value="Registrarse!" outcome="/vistas/registrarUsuario" />
                                </div>
                            </td>
                        </tr>
                    </table>
                </h:form>
            </div>
            <br/>
            <h:form>
                <p:commandLink actionListener="#{login.fbLoginEnPagina}" >
                    <h:graphicImage value="#{resource['images:conectarFb_grande.png']}" height="22" />
                </p:commandLink>
            </h:form>
        </p:outputPanel>
    </cc:implementation>
</html>